﻿@using Scrubblet.FrontEnd.Models.Entities
@model Scrubblet.FrontEnd.Models.Game


<h1>@Model.Name</h1>

@for (int j = 0; j < Model.Width; j++)
{
    for (int i = 0; i < Model.Height; i++)
    {
        //var cell = Model.BoardConfiguration.
        string cellStyle = "board-cell";

        switch (Model.CellTypes[i, j])
        {
            case BoardCellType.StartingAnchor:
                cellStyle += " starting-anchor";
                break;
            case BoardCellType.DoubleLetter:
                cellStyle += " double-letter";
                break;
            case BoardCellType.TrippleLetter:
                cellStyle += " tripple-letter";
                break;
            case BoardCellType.DoubleWord:
                cellStyle += " double-word";
                break;
            case BoardCellType.TrippleWord:
                cellStyle += " tripple-word";
                break;
        }
        
        <div class="@cellStyle" id="cell_@i.ToString() + j.ToString()">@Model[i, j]</div>
    }
    <br/>
}


<br/><br/>

@if (Model.PlayerLetters != null)
{
    for (int i = 0; i < Model.PlayerLetters.Count; i++)
    {
        <div class="player-cell" id="player_cell_@i.ToString()">@Model.PlayerLetters[i]</div>
    }
}